package com.shenmazong.thread;

/**
 * @program: server-java-demo
 * @description: ThreadMethod1
 * @author: 亮子说编程
 * @create: 2020-10-14 20:20
 **/

class ThreadDemo extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println("i="+i);
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

public class ThreadMethod1 {

    public static void main(String[] args) {
        ThreadDemo threadDemo = new ThreadDemo();
        threadDemo.start();
    }
}
